import React, { Component, useState, useContext } from 'react';
import myContext from '../context';
export default function One(props) {
    let a = useContext(myContext)
    let [num, setNum] = useState(0)
    function res() {
        props.getOneNum(num)
    }
    function isShow() {
        props.isDispaly()
    }
    return (
        <div>
            <h1>One:{num}</h1>
            <h1>contenxt传值:{a}</h1>
            <button onClick={res}>点击发送</button>
            <button onClick={isShow}>点击隐藏红色盒子</button>
        </div>
    )
}